<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PayChannel</title>
<link href="styles/general.css" rel="stylesheet" type="text/css">
<link href="styles/main.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/validator.js"></script>
<script>
function txcheck(){
	return formvalidator("all");
}
function formvalidator(obj)
{
	var controlId = "all";
	 if (typeof(obj) != "string" )
	 {
		 controlId = obj.id;
	 }
	if(controlId=="all" || controlId=="model.menuName")
	{
		if(Utils.trim(document.getElementById("model.menuName").value)=="")
		{
			document.getElementById("CompareValidator2").style.visibility="visible";
			return false;
		}
		else
		{
			document.getElementById("CompareValidator2").style.visibility="hidden";
		}
	}
	return true;
}
</script>
</head>

<body>
<form id="form1" name="form1" method="post" action="menu_save.do?type=<s:if test="type.equals('upd')">update</s:if><s:else>add</s:else>" onsubmit="return txcheck();">
 <input type="hidden" name="model.id" id="model.id" value="<s:property value="model.id"/>" />
  <h1>
        <span class="action-span"><a href="menu_list.do">菜单列表</a></span> <span
            class="action-span1"><a href="">
                首页</a> </span><span id="search_id" class="action-span1">- 菜单管理 </span>
        <div style="clear: both">
        </div>
    </h1>
    
    
    <div class="main-div">
        <table width="100%">
            <tbody>
            	<tr id="jmn">
            		<td align="center" colspan="2"><SPAN style="color:Red;"><s:property value="msg"/></SPAN></td>
            	</tr>
                <tr id="jmn">
					<td class="label">
       				菜单名称：
                    </td>
					<td>
                       <input name="model.menuName" type="text" id="model.menuName" onblur="formvalidator(this)" value="<s:property value="model.menuName"/>"/><span
                           class="require-field">*</span>&nbsp;
                        <span id="CompareValidator2" style="color:Red;visibility:hidden;">不能为空</span><br />
                    </td>
				</tr>
				
				<tr id="jmn">
					<td class="label">
       				菜单地址：
                    </td>
					<td>
                       <input name="model.menuUrl" type="text" id="model.menuUrl" value="<s:property value="model.menuUrl"/>"/>
                    </td>
				</tr>
				<tr id="jmn">
					<td class="label">
       				<a href="javascript:showNotice('passwordNotic');" title="点击此处查看提示信息">
                            <img src="img/notice.gif" width="16" height="16" border="0" alt="点击此处查看提示信息"></a>父级菜单：
                    </td>
					<td>
                       <select name="model.parentId" id="model.parentId">
                       		<option value="0">&nbsp;&nbsp;&nbsp;&nbsp;</option>
					    	<s:iterator value="list" status="m">
					    		<s:if test='parentId.equals("0")'>
					    			<option value="<s:property value="id"/>" <s:if test="model.parentId.equals(id)">selected</s:if>><s:property value="menuName"/></option>
					    		</s:if>
					    	</s:iterator>
                       </select>
                       <span class="notice-span" style="display: block;" id="passwordNotic">如果为一级菜单，则此项为空.</span>
                    </td>
				</tr>
				<tr id="jmn">
					<td class="label">
       				排序：
                    </td>
					<td>
                       <input name="model.orderNum" type="text" id="model.orderNum" 
                       value="<s:if test="model.orderNum!=null && !model.orderNum.equals('')"><s:property value="model.orderNum"/></s:if><s:else>0</s:else>"/>
                    </td>
				</tr>
                <tr>
                    <td colspan="2" align="center">
                     <s:if test="isUpdate.equals('true')">
					    <input type="submit" value=" 确定 " class="button" />
					 </s:if>
                        &nbsp;&nbsp;&nbsp;
                        <input type="reset" value=" 重置 " class="button" />
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</form>
 <!--Bottom开始-->
    
<div id="footer">
<br />
<s:property value="bottom"/></div>
    <!--Bottom结束-->
</body>
</html>